<?php

namespace Fluency\Exceptions;

use Fluency\Response;

/**
 * @package Fluency\Exceptions
 * @author  Ignas Rudaitis
 * @version 2.0.0
 */
class RedirectException extends \RuntimeException implements InterruptException
{
    private $response;

    const DEFAULT_STATUS = "HTTP/1.1 302 Found";

    public function __construct($target, $status = self::DEFAULT_STATUS)
    {
        $this->response = new Response("", array("Location: {$target}", $status));
    }

    public function getResponse()
    {
        return $this->response;
    }
}
